Javascript: Is there a way to name submit functions